package com.practise.rocketmqdemo.listen;

import com.practise.rocketmqdemo.constant.MQConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RocketMQMessageListener(consumerGroup = "cgroup21", topic = MQConstant.TOPIC_TWO,selectorExpression = "tagB")
public class TopicTwoWithTagReceiver1 implements RocketMQListener {

    @Override
    public void onMessage(Object msg) {
        log.info("监听:cgroup1 TOPIC_TWO msg:{}" ,msg);
        System.out.println("cgroup1 消费者收到消息  : " + msg);
    }
}
